class FormItem {
  int? isShowName; // 是否显示姓名
  int? isShowAge; // 是否显示年龄
  int? isShowGender; // 是否显示性别
  int? isShowCity; // 是否显示城市
  int? isShowIdentity; // 是否显示身份证
  int? isShowPersonal; // 是否显示6项
  int? isShowHuaBei; // 是否显示花呗
  int? isShowBaiTiao; // 是否显示白条
  int? isShowZmf; // 是否显示芝麻分
  List<IdAndName>? huaBeiList; // 花呗选项
  List<IdAndName>? baiTiaoList; // 白条选项
  List<IdAndName>? zmScoreList; // 芝麻分选项
  List<IdAndName>? qualificationList; // 个人资产6项
  Map<String, dynamic>? provinceList;
  Map<String, dynamic>? cityList;

  FormItem(
      {this.isShowName,
        this.isShowAge,
        this.isShowGender,
        this.isShowPersonal,
        this.isShowHuaBei,
        this.isShowBaiTiao,
        this.isShowCity,
        this.isShowZmf,
        this.isShowIdentity,
        this.huaBeiList,
        this.baiTiaoList,
        this.zmScoreList,
        this.qualificationList,
        this.provinceList,
        this.cityList});

  FormItem.fromJson(Map<String, dynamic> json) {
    isShowName = json['is_show_name'];
    isShowAge = json['is_show_age'];
    isShowGender = json['is_show_gender'];
    isShowPersonal = json['is_show_personal'];
    isShowHuaBei = json['is_show_huabei'];
    isShowBaiTiao = json['is_show_baitiao'];
    isShowCity = json['is_show_city'];
    isShowZmf = json['is_show_zmf'];
    isShowIdentity = json['is_show_identity'];
    if (json['huabei_list'] != null) {
      huaBeiList = <IdAndName>[];
      json['huabei_list'].forEach((v) {
        huaBeiList!.add(IdAndName.fromJson(v));
      });
    }
    if (json['baitiao_list'] != null) {
      baiTiaoList = <IdAndName>[];
      json['baitiao_list'].forEach((v) {
        baiTiaoList!.add(IdAndName.fromJson(v));
      });
    }
    if (json['zm_score_list'] != null) {
      zmScoreList = <IdAndName>[];
      json['zm_score_list'].forEach((v) {
        zmScoreList!.add(IdAndName.fromJson(v));
      });
    }
    if (json['qualification_list'] != null) {
      qualificationList = <IdAndName>[];
      json['qualification_list'].forEach((v) {
        qualificationList!.add(IdAndName.fromJson(v));
      });
    }
    provinceList = json['province_list'];
    cityList = json['city_list'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['is_show_name'] = isShowName;
    data['is_show_age'] = isShowAge;
    data['is_show_gender'] = isShowGender;
    data['is_show_personal'] = isShowPersonal;
    data['is_show_huabei'] = isShowHuaBei;
    data['is_show_baitiao'] = isShowBaiTiao;
    data['is_show_city'] = isShowCity;
    data['is_show_zmf'] = isShowZmf;
    data['is_show_identity'] = isShowIdentity;
    if (huaBeiList != null) {
      data['huabei_list'] = huaBeiList!.map((v) => v.toJson()).toList();
    }
    if (baiTiaoList != null) {
      data['baitiao_list'] = baiTiaoList!.map((v) => v.toJson()).toList();
    }
    if (zmScoreList != null) {
      data['zm_score_list'] = zmScoreList!.map((v) => v.toJson()).toList();
    }
    if (qualificationList != null) {
      data['qualification_list'] = qualificationList!.map((v) => v.toJson()).toList();
    }
    if (provinceList != null) {
      data['province_list'] = provinceList;
    }
    if (cityList != null) {
      data['city_list'] = cityList;
    }
    return data;
  }
}

class IdAndName {
  String? id;
  String? name;

  bool select = false;

  IdAndName({this.id, this.name, this.select=false});

  IdAndName.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['name'] = name;
    data['select'] = select;
    return data;
  }
}